#include "Syncronize.h"

namespace steam
{
	namespace smoke
	{

		Lock::Lock ()
		{
			InitializeCriticalSection(&m_cs);
		}

		Lock::~Lock ()
		{
			DeleteCriticalSection(&m_cs);
		}

		void Lock::lock ()
		{
			EnterCriticalSection(&m_cs);
		}

		void Lock::unlock ()
		{
			LeaveCriticalSection(&m_cs);
		}

		ScopedLock::ScopedLock(Lock& lock) : m_lock(lock)
		{
			m_lock.lock();
		}

		ScopedLock::~ScopedLock()
		{
			m_lock.unlock();
		}

	}
}